package org.example.text;

import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.example.JavaBean.plus.Emp;
import org.example.service.EmpService;
import org.example.util.JsonResult;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Auther:Liu
 * @Testname:Text05
 * @Date:2025/8/12 10:40
 */
@Slf4j
@SpringBootTest
public class Text05 {

    @Resource
    private EmpService empService;

    @Test
    public void a(){
        JsonResult emp = empService.findEmpById(7907);
        log.info("emp:{}", emp);
    }

    @Test
    public void b(){
        JsonResult deleted = empService.deleteEmpById(7907);
        log.info("deleted:{}", deleted);
    }

    @Test
    public void c(){
        Emp emp = new Emp();
        emp.setEmpno(7907);
        emp.setEname("王菲凡");
        emp.setJob("开发师");
        emp.setHiredate("2004-2-3");
        emp.setState(1);
        JsonResult jsonResult = empService.updateEmp(emp);
        log.info("jsonResult:{}", jsonResult);
    }

    @Test
    public void d(){
        JsonResult empById2 = empService.findEmpById2(7907);
        log.info("empById2:{}", empById2);
    }

    @Test
    public void e(){
        JsonResult jsonResult = empService.deleteEmpById2(7907);
        log.info("jsonResult:{}", jsonResult);
    }

    @Test
    public void f(){
        Emp emp = new Emp();
        emp.setEmpno(7907);
        emp.setEname("王菲凡22");
        JsonResult jsonResult = empService.updateEmp2(emp);
        log.info("jsonResult:{}", jsonResult);
    }

    @Test
    public void g(){
        JsonResult page = empService.findPage(1);
        log.info("page:{}", page);
    }


    @Test
    public void h(){
        JsonResult page1 = empService.findPage1(2);
        log.info("page1:{}", page1);
    }

    @Test
    public void i(){
        JsonResult page2 = empService.findPage2(1);
        log.info("page2:{}", page2);
    }

    @Test
    public void j(){
        JsonResult jsonResult = empService.deletePage2(7936);
        log.info("jsonResult:{}", jsonResult);
    }


    @Test
    public void k(){
        Emp emp = new Emp();
        emp.setEmpno(7909);
        emp.setEname("马三立");
        JsonResult jsonResult = empService.updatePage2(emp);
        log.info("jsonResult:{}", jsonResult);
    }
}
